- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
Add ability to use convert_query_response with Python Transforms #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to use convert_query_response with Python Transforms #376
Conversation
| Deploying infrahub-sdk-python with   | 
| Latest commit: | cfbb217 | 
| Status: | ✅ Deploy successful! | 
| Preview URL: | https://b865e123.infrahub-sdk-python.pages.dev | 
| Branch Preview URL: | https://pog-transform-convert-query.infrahub-sdk-python.pages.dev | 
| Codecov ReportAttention: Patch coverage is  
 @@             Coverage Diff             @@
##           develop     #376      +/-   ##
===========================================
+ Coverage    73.94%   75.12%   +1.18%     
===========================================
  Files           92       93       +1     
  Lines         8540     8560      +20     
  Branches      1676     1678       +2     
===========================================
+ Hits          6315     6431     +116     
+ Misses        1779     1676     -103     
- Partials       446      453       +7     
 Flags with carried forward coverage won't be shown. Click here to find out more. 
 ... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
 | 
3f7f947    to
    bdc0d4a      
    Compare
  
    | branch=branch, | ||
| infrahub_node=InfrahubNode, | ||
| convert_query_response=transform_config.convert_query_response, | ||
| ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it is worth passing the whole transform_config here instead of just convert_query_response? might make it easier to add other parameters like this in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I do, but it would require more changes in the backend when we use this outside of the CTL in situations where we haven't stored the config anywhere. I think for now we should leave it like this to not change too many things. But could be that we should do a larger refactor and consider what parts should be kept in the database and what options should only exist in Git.
bdc0d4a    to
    cfbb217      
    Compare
  
    
This PR introduced support for "convert_query_response" for Python Transforms.
Changes:
typer.testing.CliRunnerdoesn't seem to support tests for async commands like this. Instead of spending more time on that I opted to call thegeneratorfunction directly within the code for now. It would be good with a permanent solution for that but I didn't want to spend more time on it now.Fixes #281
Backend PR: opsmill/infrahub#6363